package com.math_space;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 * 简单的冒泡排序
 */
public class MaoPao {
    public static void main(String[] args) {
        /*Scanner sc = new Scanner(System.in);
        String num1 = sc.nextLine();
        String num2 = sc.nextLine();
        BigInteger n1 = new BigInteger(num1);
        BigInteger n2 = new BigInteger(num2);
        BigInteger he = n1.multiply(n2);
        System.out.println(he);*/

        Scanner sc = new Scanner(System.in);
        String shuzu = sc.nextLine();
        String sz = shuzu.substring(1, shuzu.length()-1);
        String szs[] = sz.split(",");
        int a[] = new int[szs.length];
        Integer ac[] = new Integer[szs.length];
        for (int i = 0; i< szs.length; i++){
            a[i] = Integer.parseInt(szs[i]);
            ac[i] = Integer.parseInt(szs[i]);
        }
        //直接函数(默认从小到大)
        //Arrays.sort(a);
        //从大到小 （但是必须是包装类）
        Arrays.sort(ac, (o1, o2) -> (o1 > o2)?-1:1);


        for (int i = 0; i< szs.length; i++){
            System.out.println(ac[i]);
        }

        //冒泡排序(> 表示从小到大， <表示从大到小)
        /*for(int j = 0; j < a.length; j ++){
            for(int q = j; q < a.length; q ++){
                if(a[j] < a[q]){
                    a[j] = a[j] ^ a[q];
                    a[q] = a[j] ^ a[q];
                    a[j] = a[j] ^ a[q];
                }
            }
        }
        for (int i = 0; i< szs.length; i++){
            System.out.println(a[i]);
        }*/


    }
}
